<?php use_stylesheet('teams.css') ?>
<h1>Liste des matchs Phase 1</h1>

<div id="teams">
<table class="teams">
  <thead>
    <tr>
      <th>Id</th>
      <th>Date</th>
      <th colspan="2">Team1</th>
	  <th colspan="3">Score</th>
      <th colspan="2">Team2</th>
      <!--th>Updated at</th-->
    </tr>
  </thead>
  <tbody>
    <?php
	foreach ($matchs_date as $i => $pronos_match):
			$result = $pronos_match->getP1Result();	?>
    <tr class="<?php echo fmod($i, 2) ? 'even' : 'odd' ?>">
				<td><a href="<?php echo url_for('p1match/show?id='.$pronos_match->getId()) ?>"><?php echo $pronos_match->getId() ?></a></td>
      			<td class="position"><?php echo $pronos_match->getFDate('d/m H:i') ?></td>
			    <td><img src="/pronos/images/teams/<?php echo strtolower($pronos_match->getTeam1()->getCode()) ?>.gif" /></td>
				<td align="right"><?php echo $pronos_match->getTeam1()->getName() ?></td>
				<td align="right"><?php echo $result->getScore1() ?></td>
				<td align="center">&nbsp;-&nbsp;</td>
				<td align="right"><?php echo $result->getScore2() ?></td>
				<td align="left"><?php echo $pronos_match->getTeam2()->getName() ?></td>
				<td><img src="/pronos/images/teams/<?php echo strtolower($pronos_match->getTeam2()->getCode()) ?>.gif" /></td>
				<!--td><?php echo date_format(new DateTime($result->getUpdatedAt()), 'd/m H:i') ?></td-->
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
</div>